
const getMsg = require("./getSendResult")
const multer = require("multer")
module.exports = (err,req,res,next)=>{
    if(err){
        if(err instanceof multer.MulterError){
            res.status(500).send(getMsg.getErr(err.message))
            return
        }
        const errMsg = err instanceof Error ? err.message:err
        res.status(500).send(getMsg.getErr(errMsg))
    }else{
        next()
    }
}